/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.sonrisas.tools.entities;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author DIEGOALV
 */
@Entity
@Table(name = "odontologo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Odontologo.findAll", query = "SELECT o FROM Odontologo o"),
    @NamedQuery(name = "Odontologo.findById", query = "SELECT o FROM Odontologo o WHERE o.id = :id"),
    @NamedQuery(name = "Odontologo.findByCmp", query = "SELECT o FROM Odontologo o WHERE o.cmp = :cmp"),
    @NamedQuery(name = "Odontologo.findByEspecialidad", query = "SELECT o FROM Odontologo o WHERE o.especialidad = :especialidad"),
    @NamedQuery(name = "Odontologo.findByFacultad", query = "SELECT o FROM Odontologo o WHERE o.facultad = :facultad"),
    @NamedQuery(name = "Odontologo.findByFechaingreso", query = "SELECT o FROM Odontologo o WHERE o.fechaingreso = :fechaingreso"),
    @NamedQuery(name = "Odontologo.findByActivoOdontologo", query = "SELECT o FROM Odontologo o WHERE o.activoOdontologo = :activoOdontologo"),
    @NamedQuery(name = "Odontologo.findByIdUsuario", query = "SELECT o FROM Odontologo o WHERE o.idUsuario = :idUsuario"),
    @NamedQuery(name = "Odontologo.findByFechaCreacion", query = "SELECT o FROM Odontologo o WHERE o.fechaCreacion = :fechaCreacion"),
    @NamedQuery(name = "Odontologo.findByFechaModificacion", query = "SELECT o FROM Odontologo o WHERE o.fechaModificacion = :fechaModificacion")})
public class Odontologo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "CMP")
    private int cmp;
    @Column(name = "especialidad")
    private String especialidad;
    @Column(name = "facultad")
    private String facultad;
    @Column(name = "fechaingreso")
    @Temporal(TemporalType.DATE)
    private Date fechaingreso;
    @Basic(optional = false)
    @Column(name = "activoOdontologo")
    private boolean activoOdontologo;
    @Basic(optional = false)
    @Column(name = "IdUsuario")
    private int idUsuario;
    @Column(name = "FechaCreacion")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaCreacion;
    @Column(name = "FechaModificacion")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaModificacion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "odontologoid")
    private List<Horarioodontologo> horarioodontologoList;
    @JoinColumn(name = "idPERSONA", referencedColumnName = "idPERSONA")
    @ManyToOne(optional = false)
    private Persona idPERSONA;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "odontologoid")
    private List<Reservacita> reservacitaList;

    public Odontologo() {
    }

    public Odontologo(Integer id) {
        this.id = id;
    }

    public Odontologo(Integer id, int cmp, boolean activoOdontologo, int idUsuario) {
        this.id = id;
        this.cmp = cmp;
        this.activoOdontologo = activoOdontologo;
        this.idUsuario = idUsuario;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getCmp() {
        return cmp;
    }

    public void setCmp(int cmp) {
        this.cmp = cmp;
    }

    public String getEspecialidad() {
        return especialidad;
    }

    public void setEspecialidad(String especialidad) {
        this.especialidad = especialidad;
    }

    public String getFacultad() {
        return facultad;
    }

    public void setFacultad(String facultad) {
        this.facultad = facultad;
    }

    public Date getFechaingreso() {
        return fechaingreso;
    }

    public void setFechaingreso(Date fechaingreso) {
        this.fechaingreso = fechaingreso;
    }

    public boolean getActivoOdontologo() {
        return activoOdontologo;
    }

    public void setActivoOdontologo(boolean activoOdontologo) {
        this.activoOdontologo = activoOdontologo;
    }

    public int getIdUsuario() {
        return idUsuario;
    }

    public void setIdUsuario(int idUsuario) {
        this.idUsuario = idUsuario;
    }

    public Date getFechaCreacion() {
        return fechaCreacion;
    }

    public void setFechaCreacion(Date fechaCreacion) {
        this.fechaCreacion = fechaCreacion;
    }

    public Date getFechaModificacion() {
        return fechaModificacion;
    }

    public void setFechaModificacion(Date fechaModificacion) {
        this.fechaModificacion = fechaModificacion;
    }

    @XmlTransient
    public List<Horarioodontologo> getHorarioodontologoList() {
        return horarioodontologoList;
    }

    public void setHorarioodontologoList(List<Horarioodontologo> horarioodontologoList) {
        this.horarioodontologoList = horarioodontologoList;
    }

    public Persona getIdPERSONA() {
        return idPERSONA;
    }

    public void setIdPERSONA(Persona idPERSONA) {
        this.idPERSONA = idPERSONA;
    }

    @XmlTransient
    public List<Reservacita> getReservacitaList() {
        return reservacitaList;
    }

    public void setReservacitaList(List<Reservacita> reservacitaList) {
        this.reservacitaList = reservacitaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Odontologo)) {
            return false;
        }
        Odontologo other = (Odontologo) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Odontologo[ id=" + id + " ]";
    }
    
}
